const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function (app) {

  app.use(
    createProxyMiddleware('/dictionary/', {
      target: 'http://localhost:8080',
      secure: false,
      changeOrigin: true,
      pathRewrite: {
        '^/dictionary/': '/dictionary/',
      },
    })
  );
  // 每个 app.use() 配置一个代理路径
  app.use(

    createProxyMiddleware('/member/', {
      target: 'http://localhost:8080',
      secure: false,
      changeOrigin: true,
      pathRewrite: {
        '^/member/': '/member/',
      },
    })
  );

  app.use(
    createProxyMiddleware('/checkin/', {
      target: 'http://localhost:8080',
      secure: false,
      changeOrigin: true,
      pathRewrite: {
        '^/checkin/': '/checkin/',
      },
    })
  );
};
